---
layout: m1x_soap
title: Shipment Create
---

<h2><a name="sales_order_shipment.create-Module%3AMageSales"></a>Module: Mage_Sales</h2>


<h4><a name="sales_order_shipment.create-Resource%3Asalesordershipment"></a>Resource: sales_order_shipment</h4>

<p><b>Aliases</b>:</p>
<ul>
	<li>order_shipment</li>
</ul>


<h5><a name="sales_order_shipment.create-Method%3A"></a>Method:</h5>

<ul>
	<li>sales_order_shipment.create (SOAP V1)</li>
	<li>salesOrderShipmentCreate (SOAP V2)</li>
</ul>


<p>Allows you to create a new shipment for an order.</p>


<p><b>Aliases</b>:</p>
<ul>
	<li>order_shipment.create</li>
</ul>



<p><b>Arguments</b>:</p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> string </td>
<td> sessionId </td>
<td> Session ID </td>
</tr>
<tr>
<td> string </td>
<td> orderIncrementId <br class="atl-forced-newline" /> </td>
<td> Order increment ID </td>
</tr>
<tr>
<td> array </td>
<td> itemsQty <br class="atl-forced-newline" /> </td>
<td> Array of orderItemIdQty (optional) </td>
</tr>
<tr>
<td> string </td>
<td> comment <br class="atl-forced-newline" /> </td>
<td> Shipment comment (optional) </td>
</tr>
<tr>
<td> int </td>
<td> email <br class="atl-forced-newline" /> </td>
<td> Send email flag (optional) </td>
</tr>
<tr>
<td> int </td>
<td> includeComment <br class="atl-forced-newline" /> </td>
<td> Include comment in email flag (optional) </td>
</tr>
</tbody></table>


<p><b>Returns</b>:</p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> string </td>
<td> shipmentIncrementId <br class="atl-forced-newline" /> </td>
<td> Shipment increment ID </td>
</tr>
</tbody></table>


<p>The <b>orderItemIdQty</b> content is as follows:</p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> int </td>
<td> order_item_id <br class="atl-forced-newline" /> </td>
<td> Order item ID </td>
</tr>
<tr>
<td> double </td>
<td> qty <br class="atl-forced-newline" /> </td>
<td> Quantity of items to be shipped </td>
</tr>
</tbody></table>


<p><b>Notes</b>: The array of orderItemQty is used for partial shipment. To create shipment for all order items, you do not need to specify these attributes.</p>

<h4><a name="sales_order_shipment.create-Examples"></a>Examples</h4>

<h5><a name="sales_order_shipment.create-RequestExampleSOAPV1"></a>Request Example SOAP V1</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/soap/?wsdl');

$session = $proxy-&gt;login('apiUser', 'apiKey');

$orderIncrementId = '200000006';
$orderItemId = 3;
$qty = 5;
$itemsQty = array(
	$orderItemId => $qty,
    );

$result = $proxy-&gt;call(
    $session,
    'order_shipment.create',
    array(
        $orderIncrementId,
        $itemsQty
    )
);

var_dump ($result);</pre>
		</div>
</div></div>



<h5><a name="sales_order_shipment.create-RequestExampleSOAPV2"></a>Request Example SOAP V2</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl');
$sessionId = $proxy-&gt;login('apiUser', 'apiKey');

$itemsQty = array(
    array(
        'order_item_id' => 3,
        'qty' => 3
    ),
    array(
        'order_item_id' => 4,
        'qty' => 5
    ));

$result = $proxy-&gt;salesOrderShipmentCreate($sessionId, '200000006', $itemsQty, 'shipment comment');
var_dump($result);</pre>
		</div>
</div></div>



<h5><a name="sales_order_shipment.create-RequestExampleSOAPV2%28WSIComplianceMode%29"></a>Request Example SOAP V2 (WS-I Compliance Mode)</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl'); 

$sessionId = $proxy-&gt;login((object)array('username' =&gt; 'apiUser', 'apiKey' =&gt; 'apiKey')); 

$itemsQty = array(
    array(
        'order_item_id' => 3,
        'qty' => 3
    ),
    array(
        'order_item_id' => 4,
        'qty' => 5
    ));
 
$result = $proxy-&gt;salesOrderShipmentCreate((object)array(
    'sessionId' =&gt; $sessionId-&gt;result,
    'orderIncrementId' =&gt; '200000006',
    'itemsQty' =&gt; $itemsQty,
    'comment' =&gt; 'shipment comment',
    'email' =&gt; null, 'includeComment' =&gt; null));   
    
var_dump($result-&gt;result);</pre>
		</div>
</div></div>



